package com.seecen.webproject.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result<T> {

    public static final int FAIL_CODE = 0;

    private int code;
    private String msg;
    private T data;

    public static Result fail(int code, String msg) {
        Result result = new Result(code, msg, null);
        return result;
    }
    public static Result success(Object data) {
        Result result = new Result(200, "操作成功!", data);
        return result;
    }
}
